package com.lun.blog.pojo;

import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * @Function : Message
 * @Description:
 * @Param:
 * @version: v1.0.0
 * @author: fanglj5
 * @date : 2021/3/13
 * Modification History:
 * Date Author Version Description
 * -------------------------------------------------------------
 * 时间 作者 版本号 修改原因
 */
@Entity
@Table(name = "t_message")
public class Message {

    @Id
    @GeneratedValue
    private Long id;

    private String nickname;

    private String email;

    private String context;

    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;

    @OneToMany(mappedBy = "parentMessage")
    private List<Message> replayMessage;

    @ManyToOne
    private Message parentMessage;

    private String avatar;
    private Boolean adminMessage;

    private String state;//1:审核状态 2:发布

    public List<Message> getReplayMessage() {
        return replayMessage;
    }

    public void setReplayMessage(List<Message> replayMessage) {
        this.replayMessage = replayMessage;
    }

    public Message getParentMessage() {
        return parentMessage;
    }

    public void setParentMessage(Message parentMessage) {
        this.parentMessage = parentMessage;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }


    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public Boolean getAdminMessage() {
        return adminMessage;
    }

    public void setAdminMessage(Boolean adminMessage) {
        this.adminMessage = adminMessage;
    }
}
